<template>
  <BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="500" @ok="handleSubmit">
    <a-form ref="formEl" :model="planModel" :label-col="{xs: {span: 24}, sm: {span: 6}}" :wrapper-col="{xs: {span: 24}, sm: {span: 18}}">

      <a-row>
        <a-col :span="22">
          <a-form-item label="计收月份" name="sfyf">
            <a-month-picker placeholder="请输入计收月份" valueFormat="YYYY-MM" v-model:value="planModel.sfyf" />
          </a-form-item>
        </a-col>
      </a-row>

      <a-row>
        <a-col :span="22">
          <a-form-item label="工业区" name="gyq">
            <JSearchSelect
              placeholder="请输入工业区名称"
              dict="DB_GYQB,GRQ_NAME,GRQ_NAME"
              :async="true"
              :pageSize=3
              showSearch
              v-model:value="planModel.gyq"
              optionFilterProp="label"
              resultField="list"
            />
          </a-form-item>
        </a-col>
      </a-row>

      <a-row>
        <a-col :span="22">
          <a-form-item label="企业名称" name="qymc">
            <JSearchSelect
              placeholder="请输入企业名称"
              dict="DB_QYZLB,MC,MC"
              :async="true"
              :pageSize=3
              showSearch
              v-model:value="planModel.qymc"
              optionFilterProp="label"
              resultField="list"
              labelField="name"
              valueField="id"
            />
          </a-form-item>
        </a-col>
      </a-row>

      <a-row>
        <a-col :span="22">
         <br><br><br><br>
        </a-col>
      </a-row>


    </a-form>
    <template #appendFooter>
    </template>
  </BasicModal>

</template>

<script lang="ts" setup>
  import { optionsListApi } from '/@/api/demo/select';
  import {ref, computed, unref, reactive,defineProps } from 'vue';
  import {BasicModal, useModal, useModalInner} from '/@/components/Modal';
  import {BasicForm, FormSchema, useForm,ApiSelect,JSearchSelect} from '/@/components/Form/index';
  import {formSchema} from '../DbGlfsc.data';
  import {saveOrUpdate} from '../DbGlfsc.api';
  import {defHttp} from "/@/utils/http/axios";
  import {apiGlfsc} from "../DbGlfsc.api";
  // import DbGlfscModal from "./DbGlfscModal.vue"

  import { ActionItem, BasicColumn, BasicTable, TableAction } from '/@/components/Table';
  import {useMessage} from "/@/hooks/web/useMessage";
  import { useMethods } from '/@/hooks/system/useMethods';
  import {filterObj} from "/@/utils/common/compUtils";
  import {getIfExportFapiao} from "/@/views/assets/accountReceive/DbHire.api";
  import {useRouter,useRoute} from "vue-router"
  const { createMessage, createErrorModal } = useMessage();
  const router = useRouter()
  const planModel = reactive({ });
  //设置标题

  const title = "收款通知书打印";


  const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {

  });


  //表单提交事件
  async function handleSubmit(v) {
    console.log(planModel)
    if(!planModel.sfyf) {
      createMessage.warn("请选择收款月份！")
      return;
    }

    closeModal();
    router.push({
      path: 'UrgingBillFirst',
      query:{
        qymc :planModel.qymc,
        sfyf: planModel.sfyf,
        gyq:planModel.gyq,
      }
    })

  }
  function handleSuccess(){

  }
</script>

<style lang="less" scoped>
  /** 时间和数字输入框样式 */
  :deep(.ant-input-number){
    width: 100%
  }

  :deep(.ant-calendar-picker){
    width: 100%
  }
</style>
